home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / WANDR330.ZIP / SRC / WAND_HEA.H < prev   
Encoding:
C/C++ Source or Header  |  1997-01-03  |  5.2 KB  |  218 lines

  1. #include <stdio.h>
  2. #include <curses.h>
  3. #include <string.h>
  4. #include <fcntl.h>
  5.  
  6. #ifdef TOS
  7. #define MSDOS
  8. #define VOIDPTR
  9. #endif
  10.  
  11. #ifndef MSDOS
  12. #include <sys/file.h>
  13. #endif
  14.  
  15. #define VERSION "3.3"
  16.  
  17.         /********** FILES ************/
  18.  
  19. /* Change these to the necessary directories or files */
  20. #define SCREENPATH "./screens"
  21. #define HISCOREPATH "./hiscores"
  22. #define DICTIONARY "./words"
  23. #define LOCKFILE "./wanderer.lock"
  24.  
  25.         /********** PASSWORDS *********/
  26.  
  27. /* change this to anything, but don't forget what             */
  28. #define MASTERPASSWORD "clever lights"
  29.  
  30. /* change the numbers in this as well, but keep it in the same form     */
  31. #define PASSWD (num * num * 2781 + num * 12746 + 51)
  32.  
  33. /* this is the randon number seed used for encryption              */
  34. #define BLURFL 32451
  35. /* the word blurfl is used for historical reasons             */
  36.  
  37.         /********** OPTIONS ***********/
  38.  
  39. /* To disable the recording of hiscores from games restored from saves     */
  40. /* #define NO_RESTORED_GAME_HISCORES  */
  41. #define COMPARE_BY_NAME  /* define this to compare by name, not uid     */
  42. #define NO_ENCRYPTION /* define this to disable the savefile encryptor */
  43. #define NOISY    /* do we want bells in the game ? */
  44. #define FRIENDLY /* more friendly to user                              */
  45.         /****** OTHER PARAMETERS ******/
  46.  
  47. #define GUESTUID 0    /* guestuid always compared by name     */
  48. #define EMSIZE 2048   /* size of editor moves memory          */
  49. #define ENTRIES 15    /* size of hiscore file             */
  50.  
  51.         /*********** CBREAK ***********/
  52.  
  53. /* cbreak switching via curses package.                  */
  54. /* on some Ultrix systems you may need to use crmode() and nocrmode()    */
  55. /* if so, just change the #defs to the necessary. I also know that Xenix */
  56. /* systems have to use crmode, so..                      */
  57. #ifdef XENIX
  58. #define CBON crmode()
  59. #define CBOFF nocrmode()
  60. #else
  61. #define CBON cbreak()
  62. #define CBOFF nocbreak()
  63. #endif
  64.  
  65.         /**** NOTHING TO CHANGE BELOW HERE ****/
  66.  
  67. /* I wouldn't change these if I were you - it won't give you a bigger screen */
  68. #define ROWLEN 40
  69. #define NOOFROWS 16
  70.  
  71. /* MSDOS modifications (M001) by Gregory H. Margo    */
  72. #ifdef    MSDOS
  73. #define    R_BIN    "rb"    /* binary mode for non-text files */
  74. #define    W_BIN    "wb"
  75. # ifdef    VOIDPTR
  76. #  define VOIDSTAR    (void *)
  77. # else
  78. #  define VOIDSTAR    (char *)
  79. # endif
  80. #define    ASKNAME        /* ask user's name if not in environment     */
  81. #ifndef TOS
  82. #define    COMPARE_BY_NAME    /* compare users with name, not uid        */
  83. #undef    getchar        /* remove stdio's definition to use curses'     */
  84. #define    getchar()    getch()    /* use curse's definition instead */
  85. #endif    /* not TOS */
  86.  
  87. #else /* not MSDOS */
  88. #define    R_BIN    "r"
  89. #define    W_BIN    "w"
  90. #define    VOIDSTAR
  91. #endif
  92.  
  93. /* Save and Restore game additions (M002) by Gregory H. Margo    */
  94. /* mon_rec structure needed by save.c */
  95. struct mon_rec {
  96.     int x,y,mx,my;
  97.     char under;
  98.     struct mon_rec *next,*prev;
  99. };
  100.  
  101. struct save_vars {
  102.     int z_x, z_y,
  103.     z_sx, z_sy,
  104.     z_tx, z_ty,
  105.     z_mx, z_my,
  106.     z_diamonds,
  107.     z_nf;
  108. };
  109.  
  110. struct old_save_vars {
  111.     int z_x, z_y,
  112.     z_nx, z_ny,
  113.     z_sx, z_sy,
  114.     z_tx, z_ty,
  115.     z_lx, z_ly,
  116.     z_mx, z_my,
  117.     z_bx, z_by,
  118.     z_nbx, z_nby,
  119.     z_max_score,
  120.     z_diamonds,
  121.     z_nf,
  122.     z_hd,
  123.     z_vd,
  124.     z_xdirection,
  125.     z_ydirection;
  126. };
  127.  
  128. /* prototypes added by Gregory H. Margo */
  129. #ifdef    LINT_ARGS    /* M001 */
  130. /* DISPLAY.c */
  131. extern  void map(char (*)[ROWLEN+1]);
  132. extern  void display(int, int, char (*)[ROWLEN+1]);
  133.  
  134. /* EDIT.C */
  135. extern  void instruct(void);
  136. extern  void noins(void);
  137. extern  void editscreen(int, long *, int *, int, char *);
  138.  
  139. /* FALL.C */
  140. extern  int check(int *, int *, int, int, int, int, int, int, char *);
  141. extern  int fall(int *, int *, int, int, int, int, char *);
  142.  
  143. /* GAME.C */
  144. extern  struct mon_rec *make_monster(int, int);
  145. extern  char *playscreen(int *, long *, int *, int, char *);
  146.  
  147. /* ICON.C */
  148. extern  void draw_symbol(int, int, int);
  149.  
  150. /* JUMP.C */
  151. extern  void scrn_passwd(int, char *);
  152. extern  void showpass(int);
  153. extern  int jumpscreen(int);
  154. extern  int getnum(void);
  155.  
  156. /* READ.C */
  157. extern  int rscreen(int, int *);
  158. extern  int wscreen(int, int);
  159.  
  160. /* SAVE.C */
  161. extern  void save_game(int, long *, int *, int);
  162. extern  void restore_game(int *, long *, int *, int *);
  163.  
  164. /* SCORES.C */
  165. extern  int savescore(char *, long, int, char *);
  166. extern  void delete_entry(int);
  167. extern  int erase_scores(void);
  168.  
  169. #else
  170.  
  171. /* DISPLAY.c */
  172. extern  void map();
  173. extern  void display();
  174.  
  175. /* EDIT.C */
  176. extern  void instruct();
  177. extern  void noins();
  178. extern  void editscreen();
  179.  
  180. /* FALL.C */
  181. extern  int check();
  182. extern  int fall();
  183.  
  184. /* GAME.C */
  185. extern  struct mon_rec *make_monster();
  186. extern  char *playscreen();
  187.  
  188. /* ICON.C */
  189. extern  void draw_symbol();
  190.  
  191. /* JUMP.C */
  192. extern  void scrn_passwd();
  193. extern  void showpass();
  194. extern  int jumpscreen();
  195. extern  int getnum();
  196.  
  197. /* READ.C */
  198. extern  int rscreen();
  199. extern  int wscreen();
  200.  
  201. /* SAVE.C */
  202. extern  void save_game();
  203. extern  void restore_game();
  204.  
  205. /* SCORES.C */
  206. extern  int savescore();
  207. extern  void delete_entry();
  208. extern  int erase_scores();
  209.  
  210. #endif
  211.  
  212. /* for monster movement */
  213.  
  214. #define viable(x,y) (((screen[y][x] == ' ') || (screen[y][x] == ':') ||\
  215.     (screen[y][x] == '@') || (screen[y][x] == '+') ||\
  216.     (screen[y][x] == 'S')) && (y >= 0) &&\
  217.     (x >= 0) && (y < NOOFROWS) && (x < ROWLEN))
  218.